package com.jianyun.jyzs.widget.badge;


import android.content.Context;
import android.content.Intent;


public class SamsungBadgeHandler implements IBadgeHandler {

    private Context context;

    public SamsungBadgeHandler(Context context) {
        this.context = context;
    }

    @Override
    public void updateBadgeCount(int count) {
        String launchClassName = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName()).getComponent().getClassName();
        Intent intent = new Intent("android.intent.action.BADGE_COUNT_UPDATE");
        intent.putExtra("badge_count", count);
        intent.putExtra("badge_count_package_name", context.getPackageName());
        intent.putExtra("badge_count_class_name", launchClassName);
        context.sendBroadcast(intent);
    }
}
